package com.xjust.controller.check;


import com.xjust.service.CheckResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@RestController

@RequestMapping("/checkresults")
public class CheckResultController {

    @Autowired
    private CheckResultService checkResultService;

    @GetMapping("/getCheckResult")
    public List<Map<String,Object>> getCheckResult(String tech_code,
                                                   String tech_name,
                                                   String tech_format,
                                                   BigDecimal tech_price,
                                                   String check_state,
                                                   String price_type,
                                                    String tech_type,
                                                   LocalDateTime creation_time,
    Integer check_employee_id){
        return checkResultService.getCheckResult(tech_code, tech_name,tech_format,tech_price,check_state,price_type,check_employee_id,tech_type,creation_time);
    }

    @GetMapping("/getCheckRequest")
    public  List<Map<String,Object>> getCheckRequest(LocalDateTime creation_time,
                                                     Integer check_employee_id,
                                                     String check_position,
                                                     String check_info,
                                                     String check_remark,
                                                     String check_result,
                                                     LocalDateTime check_time
                                                     ){
        return checkResultService.getCheckRequest(creation_time,check_employee_id,check_position,check_info,check_remark,check_result,check_time);
    }
}
